Skip to content

Comments

week 2 homework by zpeng#2

Open
zzpengg wants to merge 10 commits intoagileworks-tw:masterfrom
zzpengg:master
Open

week 2 homework by zpeng#2
zzpengg wants to merge 10 commits intoagileworks-tw:masterfrom
zzpengg:master

Conversation

@zzpengg
Copy link

@zzpengg zzpengg commented Jul 9, 2016

遇到一些問題
望大大幫忙解答m(_ _)m

sequelize.sync({force:true}).complete(function (err) {
 if(err){
    console.log('An error occur while creating table');
 }else{
    console.log('Item table created successfully');
 }
});

像是這個的complete它會說not define

sequelize.sync().success(function () {
  Item.create({
     id: 2,
     name:'Cell Phone',
     description: 'Sony',
     qty: 20
  }).success(function (data) {
  console.log(data.values)
 })
});

這個的success也是

@smlsunxie
Copy link
Contributor

smlsunxie commented Jul 10, 2016

程式碼可以用

```

```

包起來

@smlsunxie
Copy link
Contributor

smlsunxie commented Jul 10, 2016

你可以直接在你有問題的程式碼直接把問題標出來,像這樣,上面的問題再重問一次

2016-07-10 3 25 20

console.log('Connection has been established successfully');
})
.done();

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sequelize.authenticate().complete(function (err) {
if (err) {
console.log('There is connection in ERROR');
} else {
console.log('Connection has been established successfully');
}
});
上面是它原本的寫法,我在想說為甚麼不能像上面一樣用complete

Copy link
Contributor

@smlsunxie smlsunxie Jul 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我沒有看到 complete 的關鍵字,請指出所在行號

@smlsunxie
Copy link
Contributor

程式碼可以不用重覆貼,你所標註的地方就有你的程式碼了

})

return app;
}
Copy link
Contributor

@FuYaoDe FuYaoDe Jul 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這部分可以不用為了單獨測試 add function 而開一個 server 喔,可以在下方的 add.test.js 直接 import add.js 呼叫 add(1,1) 做測試

@zzpengg
Copy link
Author

zzpengg commented Jul 24, 2016

不知道這樣的寫法是不是作業要求?

@smlsunxie smlsunxie closed this Jul 25, 2016
@smlsunxie smlsunxie reopened this Jul 25, 2016
@zzpengg zzpengg changed the title some question week 2 homework Jul 25, 2016
@zzpengg zzpengg changed the title week 2 homework week 2 homework by zpeng Jul 25, 2016
@zzpengg
Copy link
Author

zzpengg commented Jul 31, 2016

好像終於沒有"X"了~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants